<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #app {
            box-sizing: border-box;
            padding: 10px;
        }

        #app .title {
            line-height: 50px;
            font-size: 24px;
            text-align: center;
        }

        #app .text {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px;
            margin-bottom: 10px;
        }

        #app .text input {
            height: 30px;
            width: 80%;
            border-radius: 10px;
            padding-left: 10px;
            border: 1px solid #ccc;
        }

        #app .password {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px;
            margin-bottom: 10px;
        }

        #app .password input {
            height: 30px;
            width: 80%;
            padding-left: 10px;
            border-radius: 10px;
            border: 1px solid #ccc;
        }

        #app .btn {
            display: flex;
            justify-content: center;
            margin-top: 20px;
        }

        #app .btn button {
            width: 80%;
            line-height: 30px;
            border-radius: 10px;
            border: none;
        }

        #app .main {
            display: flex;
            justify-content: space-between;
            padding: 20px 40px;
        }

        #app .foot {
            padding: 20px 40px;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="title">密码登录</div>
        <div class="text">
            <input type="text" placeholder="手机/用户名" v-model="inputText">
        </div>
        <div class="password">
            <input type="password" placeholder="密码" v-model="inputPassword">
        </div>
        <div class="btn"><button @click="information()">登录</button></div>
        <div class="main">
            <span>手机号登录</span>
            <span>忘记密码</span>
        </div>
        <div class="foot">
            <input type="checkbox">
            <span>已阅读并同意</span>
        </div>
    </div>
</body>

</html>
<script src="./vue-2.5.21.js"></script>
<script>
    var v = new Vue({
        el: '#app',
        data: {
            inputText: '',//保存输入框中的值
            tasklist: [

            ]
        },
        methods: {
            information() {
                if (this.inputText && this.inputPassword) {
                    var obj = { number: this.inputText, password: this.inputPassword }
                    this.tasklist.push(obj)
                    console.log(this.tasklist);
                }
            }
        }
    })
</script>